package com.wiscamp.ninechapters.problems.infrastructure.mappers.problems;

import com.wiscamp.ninechapters.problems.infrastructure.po.problems.QuestionPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;

/**
 * 问题仓储对象
 *
 * @author yifeng
 */
@Repository
public interface QuestionMapper extends JpaRepository<QuestionPO, Long>, JpaSpecificationExecutor<QuestionPO> {
    @Query(value = "select e from QuestionPO e where e.problemId = :problemId")
    Collection<QuestionPO> findListByProblem(long problemId);
}